import numpy as np

def checkX(x, option, data):
    # 将x限制在[lb, ub]范围内
    x = np.where(x < option['lb'], option['lb'], x)
    x = np.where(x > option['ub'], option['ub'], x)
    return x